cMdr As Integer 'count of MDR's specified in lrgMdr
cUdr As Integer 'count of UDR's specified in lrgUdr - should not reference Exclusion UDR's
wSpellState As Integer 'state relative to previous spellCheck() call
lrgch As Long 'pointer to buffer area of text to be spell checked
lrgMdr As Long 'list of main dictionaries to use when spelling the buffer
lrgUdr As Long 'list of user dictionaries to use when spelling the buffer - should not reference Exclusion UDR's
End Type
'Spell Return Buffer Structure
Type SpellReturnBufferType
ichError As Integer 'position in the SIB
cchError As Integer 'length of error "word" in SIB
scrs As Integer 'spell check return status
csz As Integer 'count of sz's put in buffer
cchMac As Integer 'current total of chars in buffer
cch As Integer 'total space in lrgch. Set by App.
lrgsz As Long 'pointer to alternatives, null delimited
lrgbRating As Long 'pointer to rating value for each suggestion returned
cbRate As Integer 'number of elements in lrgbRating
End Type
'Main Dictionary Structure
Type MdrType
Mdr As Integer
Lid As Integer
Udr As Long
End Type
Type WizSpecCharsType
bIgnore As String * 1
bHyphenHard As String * 1
bHyphenSoft As String * 1
bHyphenNonBreaking As String * 1
bEmDash As String * 1
bEnDash As String * 1
bEllipsis As String * 1
rgLineBreak As String * 2
rgParaBreak As String * 2
End Type
Declare Sub SpellVer Lib "msspell.dll" (spellVersion As Integer, SpellEngineType As Integer, spellFunctionality As Integer)
Declare Function SpellVerifyMdr Lib "msspell.dll" (ByVal csMainDictionary As String, ByVal lidExpected As Integer, LanguageIdentifier As Integer) As Long
Declare Function SpellInit Lib "msspell.dll" (csSpellIdentifier As Long, Wsc As WizSpecCharsType) As Integer
Declare Function SpellOpenMdr Lib "msspell.dll" (ByVal csSpellIdentifier As Long, ByVal csMainDictionary As String, ByVal ExclusionDictionary As String, ByVal createUdrFlag As Integer, ByVal Cache As Integer, ByVal lidExpected As Integer, csMainDictionaryReference As MdrType) As Integer
Declare Function SpellOpenUdr Lib "msspell.dll" (ByVal csSpellIdentifier As Long, ByVal csUserDictionary As String, ByVal createUdrFlag As Integer, ByVal udrPropertyType As Integer, ByVal udrReferenceId As Integer, ByVal udrReadOnlyFlag As Integer) As Integer
Declare Function SpellOptions Lib "msspell.dll" (ByVal csSpellIdentifier As Long, ByVal SpellOption As Long) As Integer
Declare Function SpellCheck Lib "msspell.dll" (ByVal csSpellIdentifier As Long, ByVal spellCheckCommand As Integer, spellInputBuffer As SpellInputBufferType, spellReturnBuffer As SpellReturnBufferType) As Integer
Declare Function SpellAddChangeUdr Lib "msspell.dll" (ByVal csSpellIdentifier As Long, ByVal udrReferenceId As Integer, ByVal StringToReplace As String, ByVal StringToReplaceWith As String) As Integer
Declare Function SpellTerminate Lib "msspell.dll" (ByVal csSpellIdentifier As Long, ByVal fForce As Integer) As Integer
'Flag values for wSpellState field in Sib
Global Const fssNoStateInfo = 0
Global Const fssIsContinued = 1
Global Const fssStartsSentence = 2
Global Const fssIsEditedChange = 4
'Ram Cache User Dictionary Reference
Global Const udrChangeOnce = &HFFFC 'UDR reserved reference for Change Once List
Global Const udrChangeAlways = &HFFFD 'UDR reserved reference for Change Always List
Global Const udrIgnoreAlways = &HFFFE 'UDR reserved reference for Ignore Always List
'Spell Language ID's
Global Const lidAmerican = &H409
Global Const lidAustralian = &HC09
'Spell Language Definitions
Global Const ldefAmerican = "American English"
Global Const ldefAustralian = "English Australian"
'Spell ID Engine's
Global Const sidSA = 1 'SoftArt
Global Const sidHM = 2 'Houghton-Mifflin
'Spell ID Engine Definitions
Global Const sdefSA = "SoftArt"
Global Const sdefHM = "Houghton-Mifflin"
'Spell Check Command Definitions
Global Const sccVerifyWord = 1
Global Const sccVerifyBuffer = 2
Global Const sccSuggest = 3
Global Const sccSuggestMore = 4
Global Const sccHyphInfo = 5
Global Const sccWildcard = 6
Global Const sccAnagram = 7
'Spell Check return status identifiers
Global Const scrsNoErrors = 0 'all buffers processed
Global Const scrsUnknownInputWord = 1 'unknown word
Global Const scrsNoMoreSuggestions = 8 'no more suggestions
Global Const scrsNoSentenceStartCap = 10 'start of sentence was not captialized
Global Const scrsRepeatWord = 11 'repeat word found
Global csSpellIdentifier As Long
Global csMainDictionaryReference As MdrType
Global csMainDictionary As String
Global csUserDictionary As String
Global csTextBuffer As String
Global csTextBufferOffset As Integer
Global csSuggestionList As String
Global csReturnStatus As Integer
Global csUnknownWordLength As Integer
Global csUnknownWordStart As Integer
'Spell Options Bitfield Definitions
Global Const soFindUncappedSentences = &H10
Global Const soFindRepeatWord = &H40
'Common Speller
Global Const csChange = 1
Global Const csCancel = 2
Global Const csDone = 3
Global Const csError = 4
'Common Speller Return Status
Global Const csrsChange = 1
Dim spellReturnBuffer As SpellReturnBufferType
Dim spellInputBuffer As SpellInputBufferType
Dim hInputBuffer%, lpszInputBuffer&, addrInputBuffer&
Dim hAlternativesBuffer%, lpszAlternativesBuffer&, addrAlternativesBuffer&
Dim hRatingsBuffer%, lpszRatingsBuffer&, addrRatingsBuffer&